<template>
<div class='left-chart-1'>
    <dv-scroll-board
        :config='config'
        style='width: 100%; height: 100%'
        @click='click'
      />
      <!-- <button >按钮</button> -->
  </div>
</template>

<script>
import axios from 'axios'

export default {
  name: 'RightTable',
  data () {
    return {
      config: {
        data: [],
        align: ['center', 'center', 'center', 'center', 'center'],
        columnWidth: [40]
      }
    }
  },
  mounted () {
    this.click()
  },
  methods: {
    async click () {
      const data = {
        id: 666,
        name: 'tracy'
      }
      await axios
        .post(
          'https://ba10db37-f6ef-4aa6-803f-ad6ffea9d12d.mock.pstmn.io/api/v1/friends/addFriends',
          data
        )
        .then(res => {
          const arrlistresult = []
          res.data.data.map(item => {
            const arrlist = [item.num, item.name, item.company, item.a, item.b]
            return arrlistresult.push(arrlist)
          })
          this.$data.config = {
            header: ['排名', '分行', '供应商名称', '宣传费交易额', '金额占比'],
            align: ['left', 'left', 'left', 'left', 'left'],
            data: arrlistresult,
            columnWidth: [50, 100, 250, 100, 100],
            waitTime: 1000,
            oddRowBGC: '',
            evenRowBGC: ''
          }
          console.log(this.config)
        })
    }
  }
}
</script>

<style lang='less' scoped>
.left-chart-1 {
  width: 100%;
  height: 100%;
  flex-grow: 0;
  flex-direction: column;
  // margin-left: -15px;
}
</style>
